package com.itheima.model.behavior.pojos;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 用户画像实体类 (MongoDB)
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "user_profile")
public class UserProfile implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    private String id;

    @Field("user_id")
    @Indexed(unique = true)
    private Integer userId;

    @Field("total_reading_time")
    private Integer totalReadingTime;

    @Field("total_books_read")
    private Integer totalBooksRead;

    @Field("active_days")
    private Integer activeDays;

    @Field("favorite_category")
    @Indexed
    private String favoriteCategory;

    @Field("reading_level")
    @Indexed
    private String readingLevel;

    @Field("preference_tags")
    private List<String> preferenceTags;

    @Field("last_active_time")
    private Date lastActiveTime;

    @Field("create_time")
    private Date createTime;

    @Field("update_time")
    private Date updateTime;
}
